#ifndef __I2C_H__
#define __I2C_H__

#include "ADuCM4050.h"
#include "GPIO.h"
#include "DELAY.h"

#define I2C_SDA P2_O(4)
#define I2C_SCL P2_O(5)
#define I2C_READ_SDA P2_I(4)

void I2C_AN_SDA_OUT(void);
void I2C_AN_SDA_IN(void);
void I2C_AN_Start(void);
void I2C_AN_Stop(void);
uint8_t I2C_AN_Wait_Ack(void);
void I2C_AN_Ack(void);
void I2C_AN_No_Ack(void);
void I2C_AN_Send_Byte(uint8_t txd);
uint8_t I2C_AN_Read_Byte(void);
uint8_t I2C_AN_Slave_Ack(uint8_t slave_add);

void TMP75_WriteOneByte(uint8_t DeviceAdd,uint8_t PointAddr,uint8_t DataToWrite);
void TMP75_WriteOneWord(uint8_t DeviceAdd,uint8_t PointAddr,uint16_t DataToWrit);
uint8_t TMP75_ReadOneByte(uint8_t DeviceAdd, uint8_t PointAddr);
uint16_t TMP75_ReadOneWord(uint8_t DeviceAdd, uint8_t PointAddr);

#endif

